package com.blank.task18;


import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.List;

public class WriteFileList {
    public static void writeList(List<Student> studentList){
        ObjectOutputStream oos = null;
        try {
            //
            oos = new ObjectOutputStream(new FileOutputStream("d:/student/stuList.txt"));
            oos.writeObject(studentList);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if(null != oos){
                try {
                    oos.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
